from tkinter import*
root = Tk()

root.title("Марафоно программированию")
root.geometry("500x500")
canvas = Canvas(bg = "white", width = 500, height=500)
canvas.pack(anchor=CENTER, expand=1)
x = int(input("введите cмешение по x:"))
y = int(input("введите смешение по y:"))
n = int(input("введите коэффицент увеличени n:"))

x1,y1 = 0*n+x, 0*n+y
x2,y2 = 10*n+x, 0*n+y
x3,y3 = 10*n+x, 10*n+y
x4,y4 = 20*n+x, 10*n+y
x5,y5 = 20*n+x, 0*n+y
x6,y6 = 30*n+x, 0*n+y
x7,y7 = 30*n+x, 20*n+y
x8,y8 = 0*n+x, 20*n+y
canvas.create_polugon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)

if n>=0 and 0*n+x>=0 and 0*n+y and 20*n+x<=500 and 30*n+y<=500:
    x1,y1 = 0*n+x, 0*n+y
    x2,y2 = 10*n+x, 0*n+y
    x3,y3 = 10*n+x, 10*n+y
    x4,y4 = 20*n+x, 10*n+y
    x5,y5 = 20*n+x, 0*n+y
    x6,y6 = 30*n+x, 0*n+y
    x7,y7 = 30*n+x, 20*n+y
    x8,y8 = 0*n+x, 20*n+y
    canvas.create_polugon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
    
elif n<0 and 0*abs(n)+x>=0 and 0*abs(n)+y>=0 and 30*abs(n)+x>=500:
    x1,y1 = 0*n+x, 0*n+y
    x2,y2 = 10*n+x, 0*n+y
    x3,y3 = 10*n+x, 10*n+y
    x4,y4 = 20*n+x, 10*n+y
    x5,y5 = 20*n+x, 0*n+y
    x6,y6 = 30*n+x, 0*n+y
    x7,y7 = 30*n+x, 20*n+y
    x8,y8 = 0*n+x, 20*n+y
    canvas.create_polugon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
    
else:
    print("Размер фигуры превышает максимальный размер поля")
root.mainloop

